<?php

namespace app\controller\web;

use app\controller\web\Common;

/**
 * Author: SongYl
 * DateTime: 2025/7/23 14:47
 */

class Profile extends Common
{
    protected $model;

    protected function _initialize()
    {
        $this->model = new \app\model\Students();
    }

    public function info()
    {
        $userInfo = $this->getLoginUserInfo();
        return $this->success('数据获取成功', $userInfo);
    }

    public function update()
    {
        $param = $this->request->post();

        $uId = $param['uId'];
        unset($param['uId']);
        $result = $this->model->where('id', $uId)->update($param);

        if (!is_numeric($result))
            return $this->error('更新失败');


        return $this->success('更新成功');

    }
}